package com.xmy.cultivate.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.AppointSchool;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xmy.cultivate.entity.OrderApply;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 指定校区 Mapper 接口
 * </p>
 *
 * @author min
 * @since 2022-08-02
 */
public interface AppointSchoolMapper extends BaseMapper<AppointSchool> {


    @Select("select school_id from appoint_school where for_id = #{forId} and type = #{type} and deleted = 0")
    public abstract List<Long> getSchoolIdListForForId(@Param("forId") Long forId,@Param("type") Integer type);

    @Select("select b.name from appoint_school as a LEFT JOIN organization as b on a.school_id = b.id where a.for_id = #{forId} and a.type = #{type} and a.deleted = 0")
    public abstract List<String> getSchoolNameListForForId(@Param("forId") Long forId,@Param("type") Integer type);
}
